<template>
    <h3>用户资产汇总</h3>
    <table>
        <thead>
            <tr style="background-color: :aqua;">
                <td>登录名称</td>
                <td>投资总额</td>
                <td>理财总额</td>
                <td>总额</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="item in data">
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.SumUF_Money.toFixed(2) }} CNY</td>
                <td>{{ item.SumUF_Money.toFixed(2) }} CNY</td>
                <td>{{ (item.SumUF_Money + item.SumUF_Money).toFixed(2) }} CNY</td>
            </tr>
        </tbody>
    </table>
</template>

<script setup lang="ts">
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
import { onMounted, ref } from 'vue'
import axios from 'axios';

const data = ref([{
    UL_Name: '',
    SumUI_Money: 0,
    SumUF_Money: 0
}]);

onMounted(() => {
    axios({
        method: "get",
        url: "https://localhost:44305/api/Users/ShowAllUserAssetinfo"
    })
        .then(function (res) {
            data.value = res.data;
        })
})

</script>